{% extends 'base.html' %}

{% block scripts %}
  {{ block.super }}
  <script src="{{ STATIC_URL }}js/js.js" type="text/javascript"></script>
  <script type="text/javascript">js.jsRoot="{{ STATIC_URL }}js/"</script>
  <script src="{{ STATIC_URL }}js/vkontakte.js" type="text/javascript"></script>
  <script src="{{ STATIC_URL }}js/facebook.js" type="text/javascript"></script>
{% endblock %}

{% block content %}
  <p></p>{% if messages %}{% for message in messages %}
    {% if message.message == 'authorization_error' %}
      <script type="text/javascript">
        js.include('rare_tools');
        UItools.showAuthError();
      </script>
    {% endif %}
  {% endfor %}{% endif %}
  <p><a href="{% url core.views.auth.login_openid %}">Try to login with openid</a></p>

  <div id="vk_api_transport"></div>
	<script type="text/javascript">
	  var vkontakte = new Vkontakte();
	  vkontakte.initVkontakteAPI();
	</script>
	<input type="button" value="login with VKontakte" onclick="vkontakte.doLogin();">
  
  <div id="fb-root"></div>
  <script>
    var facebook = new Facebook();
    facebook.initFacebookAPI();
  </script>
  <input type="button" value="login with Facebook" onclick="facebook.doLogin();">

  <p>Or you can proceed with default login process:</p>
  <form action="" method="post">
    {{ form.as_p }}
    <input type="submit" value="Submit" />
  </form>

  <p><a href="{% url core.views.register %}">Register</a> if you haven't login/password at our service yet.</p>
{% endblock %}
